package com.shizhanzhe.zxbapp.vip;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import com.shizhanzhe.zxbapp.R;
import com.shizhanzhe.zxbapp.bean.UserBean;
import com.xianwan.sdklibrary.util.XWUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by zz9527 on 2018/12/5.
 */
public class WebFragment extends Fragment {
    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_web,container,false);
    }

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        XWUtils.getInstance(getContext()).init("2751","bc0e6dsi4yfg23fb", UserBean.uid+"");
        ListView lv = view.findViewById(R.id.lv);
        List<String> list=new ArrayList<>();
        list.add("闲玩游戏");
        lv.setAdapter(new ArrayAdapter(getContext(), android.R.layout.simple_list_item_1, list));
        lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
                XWUtils.getInstance(getContext()).jumpToAd();
            }
        });
    }
}
